<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<?php 
	include_once('../DAO/DonHangDTO.php');
	include_once('../DAO/ChiTietDonHangDTO.php');
	include_once('../DAO/DonHangDAO.php');
	
	?>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Thông tin shop</title>
		<link rel="stylesheet" href="../css/reset.css" type="text/css" />
		<link rel="stylesheet" href="../css/common.css" type="text/css" />
		<link rel="stylesheet" href="../css/seller.css" type="text/css" />
		<script src="../scripts/jquery-1.5.2.min.js"></script>
		<script src="../scripts/common.js"></script>
		<script type="text/javascript" language="javascript">
			var xmlhttp;
			function GetXmlHttpObject()
			{
				if (window.XMLHttpRequest)
				{
					// code for IE7+, Firefox, Chrome, Opera, Safari
					return new XMLHttpRequest();
				}
				if (window.ActiveXObject)
				{
					// code for IE6, IE5
					return new ActiveXObject("Microsoft.XMLHTTP");
				}
				return null;
			} 
			function ThemMoi(id)
			{
				xmlhttp=GetXmlHttpObject();
				xmlhttp.onreadystatechange=Reload;
				var serverUrl="../DAO/DanhSachDonHangDAO.php?id="+id;
				xmlhttp.open("get",serverUrl,true);
				xmlhttp.send(null);
				//alert("1");
			}
			function Reload()
			{
				if(xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				alert("2");
					var div=document.getElementById("tbody");
					div.innerHTML=xmlhttp.responseText;
				}
			}
		</script>
	</head>
	<body>
		<div id="page">
			<?php
				require("../DAO/DataHelper.php");
				require("../webconfig.php");
				include_once("../UserControl/header.php");
			?>

			<div id="content">
				<div id="shop-banner">
					<img src="../temp/shop-banner.jpg" />
				</div>
				<?php
					require("../UserControl_NguoiBan/MenuDanhMucChucNang.php");
				?>
				<div id="seller-shop-info" class="block layout-2col-col2">
					<div class="title">
					  <h3>Chi Tiết Đơn Hàng </h3>
				  </div>
					<div class="content" id="content">
<?php
	if(isset($_REQUEST['id']))
	{

		$id = $_REQUEST['id'];
		$Ten = $_REQUEST['Ten'];	
		}
?>
		<tr>
			<td>Đơn hàng của <strong><?php echo $Ten ?> </strong><br/></td>
		</tr>
		<tr>
			<td>Mã đơn hàng: <strong><?php echo $id ?></strong></td>
		</tr>
						<table style="width: 666px;" id="gradient-style" summary="Meeting Results">
						
                            <thead>
                                <tr>
                                <th style="text-align: center" scope="col">Mã sản phẩm </th>
								 <th style="text-align: center" scope="col">Số lượng </th>
                                <th style="text-align: center" scope="col">Đơn giá </th>
                                </tr>
                            </thead>
                            
 
                            <tbody id="tbody">
<?php
	if(isset($_REQUEST['id']))
	{
		$id = $_REQUEST['id'];
		$result = DonHangDao::DanhSachChiTietDonHang($id);
		if(count($result)>0)
		{
		for($i = 0 ; $i < count($result) ; $i++)
		{
			$row = $result[$i];
		?>
										<tr>
										<td style="background: #d1d1d1; text-align: center;"><?php echo $row->ctdh_ten_san_pham?></td>
										<td style="background: #d1d1d1; text-align: center;"><?php echo $row->ctdh_so_luong?></td>
										<td style="background: #d1d1d1; text-align: center;"><?php echo $row->ctdh_don_gia?></td>
										
										</tr>
		<?php
			}
			}
		}
?>  
                            </tbody>
                      </table> 
 						
					</div>
				</div>
			</div>
			<?php
				require("../UserControl/footer.php");
			?>
		</div>
	</body>
</html>